#include "RBTree.hpp"
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;

void Test1(){
  //int arr[] = {16, 3, 7, 11, 9, 26, 18, 14, 15};
  int arr[] = {1,2,3,4,5,6,7,8,9,10};
  RBTree<int, int> rbt;
  for(auto e : arr)
  {
    rbt.Insert(make_pair(e, e*10));
  }
  rbt.Inorder();
  cout << "IsValidRBTree: " << rbt.IsValidRBTree() << endl;
  if(rbt.Find(12) == nullptr)
    cout << "xxx" << endl;
  if(rbt.Find(3) != nullptr)
    cout << "yyy" << endl;
}

void Test2(){
  srand(time(NULL));
  RBTree<int, int> rbt;
  const int N = 10000;
  for(int i = 0; i<N; ++i)
  {
    int x = rand();
    rbt.Insert(make_pair(x, i));
  }
  cout << "IsValidRBTree: " << rbt.IsValidRBTree() << endl;
}

int main(){
  Test1();
  return 0;
}
